package com.webAutoTest.common;

import java.util.Random;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2023/2/27 14:35
 */

public class ParamUtil {
    private String[] productnames = new String[]{"西瓜","苹果","雪梨","橙子","葡挞皮","菠萝"};

    private Random random = new Random();


    public String getProductname(){


        int pivot = random.nextInt(productnames.length);


        return productnames[pivot];

    }

    public int getStock(){
        int stock = random.nextInt(100);

        if(stock<1){
            stock =1;
        }
        return stock;
    }

    public double getPrice(){
        int priceInt = random.nextInt(10000);
        double price = priceInt/100.0;
        if(price==0.0){
            price =1.0;
        }
        return price;
    }

    public int getDiscount(){

        int discount = random.nextInt(100);

        return discount;
    }


}
